﻿using System;
using System.Globalization;
using System.Resources;

namespace XamlFoundation.Globalization
{
    public class ResxLocalizationProvider : ILocalizationProvider
    {
        private readonly ResourceManager _resourceManager;

        public ResxLocalizationProvider(Type resourceType)
        {
            _resourceManager = new ResourceManager(resourceType);
        }

        public object GetResource(string key, CultureInfo language)
        {
            return _resourceManager.GetObject(key, language);
        }
    }
}
